import request from "@/utils/request";

// 获得设备支持的类型
export function getDeviceInfoDetailsApi(params) {
  return request({
    url: "/cgi-bin/entry.cgi/system/device-info-details",
    method: "get",
    params,
  });
}

// 系统状态查询
export function getDeviceStatusApi(params) {
  return request({
    url: "/cgi-bin/entry.cgi/system/device-status",
    method: "get",
    params,
  });
}

// 获取网络设置LAN
export function getNetworLanApi(params) {
  return request({
    url: "/cgi-bin/entry.cgi/network/lan",
    method: "get",
    params,
  });
}
// 修改LAN
export function editNetworLanApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/network/lan",
    method: "put",
    data,
    noLoading: true,
  });
}

// get Wlan
export function getNetworkWlanApi(params) {
  return request({
    url: "/cgi-bin/entry.cgi/network/wlan?timestamp=" + new Date().getTime(),
    method: "get",
    params,
  });
}
//get port
export function getNetworkPortApi() {
  return request({
    url: "/cgi-bin/entry.cgi/network-port?timestamp=" + new Date().getTime(),
    method: "get",
  });
}

// WiFi设置是否启用
// export function getNetworkWiFiOpenCloseApi() {
//   return request({
//     url: "/cgi-bin/entry.cgi/network/wifi",
//     method: "get",
//   });
// }

// WIFI开启关闭
// export function editNetworkWiFiOpenCloseApi2(data) {
//   return request({
//     url: "/cgi-bin/entry.cgi/network/wifi?power=" + data,
//     method: "put",
//   });
// }

// 点击连接
export function editNetworkWiFiOpenCloseApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/network/wifi",
    method: "post",
    data,
  });
}

export function getNetworkFtpApi() {
  return request({
    url: "/cgi-bin/entry.cgi/network/ftp",
    method: "get",
  });
}

// 获取WiFi启用状态
export function getNetworkWiFiEnableApi() {
  return request({
    url: "cgi-bin/entry.cgi/network/wifi-enable",
    method: "get",
  });
}
// 设置WiFi启用状态
export function setNetworkWiFiEnableApi(data) {
  return request({
    url: "cgi-bin/entry.cgi/network/wifi-enable",
    method: "post",
    data
  });
}

// 轮询获取WiFi scan列表
export function putNetworkScanApi() {
  return request({
    url: "cgi-bin/entry.cgi/network/wifi?scan=1",
    method: "put",
  });
}

// 获取wifi状态
export function getNetworkWiFiStatusApi() {
  return request({
    url:
      "/cgi-bin/entry.cgi/network/get_wifi_status",
    method: "get",
  });
}

// 获取WiFi列表
export function getNetworkWiFiListApi() {
  return request({
    url:
      "/cgi-bin/entry.cgi/network/wifi-list",
    method: "get",
  });
}
// 删除WiFi
export function delNetworkWiFiListApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/network/del-wifi",
    method: "post",
    data
  });
}

// 删除失败WiFi 再次回调
export function getAutoCntWifi() {
  return request({
    url: "cgi-bin/entry.cgi/network/auto-cnt-wifi",
    method: "get",
  });
}

// 获取闸机配置
export function getNetworPeripheralsApi() {
  return request({
    url: "/cgi-bin/entry.cgi/peripherals/gate",
    method: "get",
  });
}
export function editNetworPeripheralsApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/peripherals/gate",
    method: "put",
    data,
  });
}

// 获取显示屏配置
export function getNetworPeripheralsFillApi() {
  return request({
    url: "/cgi-bin/entry.cgi/peripherals/fill-light",
    method: "get",
  });
}
export function editNetworPeripheralsFillApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/peripherals/fill-light",
    method: "put",
    data,
  });
}

// AIOT配置获取
export function getAiotApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/aiot",
    method: "get",
    data,
  });
}
// 修改AIOT配置
export function editAiotApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/aiot",
    method: "post",
    data,
  });
}

// 获取rtsp参数
export function getRtspConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/rtsp-config",
    method: "get",
    data,
  });
}

// 修改rtsp参数
export function editRtspConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/rtsp-config",
    method: "post",
    data,
  });
}

// 获取gb28181
export function getGb28181Api(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/gb28181",
    method: "get",
    data,
  });
}

// 修改gb28181
export function editGb28181Api(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/gb28181",
    method: "post",
    data,
  });
}

// 获取1400
export function getGa1400Api(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/ga1400",
    method: "get",
    data,
  });
}
// 修改1400
export function editGa1400Api(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/ga1400",
    method: "post",
    data,
  });
}

// 获取第三方平台
export function getThirdpartyApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/thirdparty-platform",
    method: "get",
    data,
  });
}

// 修改第三方平台
export function editThirdpartyApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/platform/thirdparty-platform",
    method: "post",
    data,
  });
}

// 获取云台识别平台配置
export function getCloudConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/cloud-config",
    method: "get",
    data,
  });
}

// 修改云台识别平台配置
export function editCloudConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/set-cloud-config",
    method: "post",
    data,
  });
}

// 获取对讲协议配置
export function getTalkConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/talk-config",
    method: "get",
    data,
  });
}

// 修改对讲协议配置
export function editTalkConfigApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/talk-config",
    method: "put",
    data,
  });
}

// 获取媒体服务设置
export function getMediaServerSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-server-setting",
    method: "get",
    data,
  });
}

// 修改媒体服务设置
export function editMediaServerSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-server-setting",
    method: "post",
    data,
  });
}

// 获取媒体图片列表
export function getMediaPictureSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-picture-setting",
    method: "get",
    data,
  });
}

// 新增媒体图片列表
export function addMediaPictureSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-picture-setting",
    method: "post",
    data,
  });
}
// 修改媒体图片列表
export function editMediaPictureSettingApi(data, id) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-picture-setting/${id}`,
    method: "post",
    data,
  });
}

// 删除媒体图片
export function delMediaPictureSettingApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-picture-setting/${data}`,
    method: "delete",
  });
}

// 批量删除媒体图片
export function delMediaPictureSettingBatchApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-picture-setting-delete-batch`,
    method: "post",
    data,
  });
}
// 全部清除媒体图片
export function delMediaPictureSettingResetApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-picture-setting-reset`,
    method: "delete",
    data,
  });
}

// 获取媒体视频列表
export function getMediaVideoSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-video-setting",
    method: "get",
    data,
  });
}

// 修改媒体视频列表
export function editMediaVideoSettingApi(data, id) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-video-setting/${id}`,
    method: "post",
    data,
  });
}

// 新增媒体视频列表
export function addMediaVideoSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-video-setting",
    method: "post",
    data,
  });
}

// 删除媒体视频
export function delMediaVideoSettingApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-video-setting/${data}`,
    method: "delete",
  });
}

// 批量删除媒体视频
export function delMediaVideoSettingBatchApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-video-setting-delete-batch`,
    method: "post",
    data,
  });
}

// 全部清除媒体视频
export function delMediaVideoSettingResetApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-video-setting-reset`,
    method: "delete",
  });
}

// 获取媒体网页列表
export function getMediaWebsiteSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-website-setting",
    method: "get",
    data,
  });
}

// 新增媒体网页列表
export function addMediaWebsiteSettingApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-website-setting",
    method: "post",
    data,
  });
}

// 修改媒体网页列表
export function editMediaWebsiteSettingApi(data, id) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-website-setting/${id}`,
    method: "post",
    data,
  });
}

// 删除媒体网页列表
export function delMediaWebsiteSettingApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/media-website-setting/${data}`,
    method: "delete",
  });
}

// 批量删除媒体网页
export function delMediaWebsiteSettingBatchApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-website-setting-delete-batch",
    method: "post",
    data,
  });
}

// 全部清除媒体网页
export function delMediaWebsiteSettingResetApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/media-website-setting-reset",
    method: "delete",
    data,
  });
}

// 获取插件配置
export function getPluginConfig(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/get_plugin_config",
    method: "post",
    data,
  });
}

// 修改插件配置
export function setPluginConfig(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/set_plugin_config",
    method: "post",
    data,
  });
}

// 获取插件状态
export function getPluginStatus(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/get_plugin_status",
    method: "post",
    data,
  });
}
